import calendar
from datetime import datetime

class ExpiryDate(object):
    def __init__(self, month, year):
        self.month = month
        self.year = year

    def __unicode__(self):
        return unicode(self.expiration().strftime("%m/%y"))
        
    __repr__ = __unicode__

    def is_expired(self):
        return datetime.now() > self.expiration()

    def expiration(self):
        return datetime(int(self.year), int(self.month), calendar.monthrange(self.year,self.month)[1], 23, 59, 59, 59)